% 通过泽尼克多项式构造一组圆域内任意孔状的正交多项式
function FM = ZM2FM(M, ZM, mask)

j_max = size(ZM,3);
FM = zeros(size(ZM));
for i = 1:j_max
    C = 0;
    for j = 1:i
        C = C + M(i,j)*ZM(:,:,j);
    end
    C(~mask) = 0;
    FM(:,:,i) = C;
end
% end of the function
end